package com.kuang.controller;

import com.kuang.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class HelloController {


    @GetMapping("/hello")
    public String Hello(){
        return "hello";
    }

    //只要我们的接口中的返回值存在实体类，它就会被扫描到swagger
    @PostMapping("/user")
    public User user(){
        return new User();
    }


    //@ApiOperation放在方法上用来注释作用
    @ApiOperation("Hello控制")
    @GetMapping("/hello2")
    public String hello2(@ApiParam("用户名") String username){
        return "hello"+username;
    }
}
